

#include <sys/cdefs.h>
__RCSID("$NetBSD: atomic_store.c,v 1.2 2014/07/06 01:19:45 joerg Exp $");

#include "atomic_op_namespace.h"

#include <sys/types.h>
#include <sys/atomic.h>

#define atomic_store_n(n,b) \
void __atomic_store_ ## n(volatile uint ## b ## _t *, uint ## b ## _t, int); \
void \
__atomic_store_ ## n(volatile uint ## b ## _t *ptr, uint ## b ## _t val, \
                     int memmodel) \
{ \
	membar_enter(); \
	*ptr = val; \
	membar_exit(); \
}

atomic_store_n(1, 8)
atomic_store_n(2, 16)
atomic_store_n(4, 32)
#ifdef	__HAVE_ATOMIC_CAS_64_UP
atomic_store_n(8, 64)
#endif
